// 获取
export function getLocalStorage(key) {
  return localStorage.getItem(key);
}
// 保存
export function setLocalStorage(key, value) {
  localStorage.setItem(key, value);
}
// 获取 对象或数组
export function getObjectLocalStorage(key) {
  let val;
  try {
    val = JSON.parse(localStorage.getItem(key) as string);
  } catch (error) {
    console.error(error);
  }
  return val;
}
// 保存 对象或数组
export function setObjectLocalStorage(key, value) {
  localStorage.setItem(key, JSON.stringify(value));
}
// 获取
export function removeLocalStorage(key) {
  localStorage.removeItem(key);
}
